package util.mycomponents{
	
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	import mx.events.EffectEvent;
	
	import spark.components.Image;
	import spark.effects.Fade;
	import spark.effects.Resize;

	public class MyBlinkImg extends Image
	{
		private var blinkTimer:Timer;
		private var tempEf:Fade;
		public function MyBlinkImg():void
		{			
			
			this.blinkTimer = new Timer( 1000 , 6 );
			tempEf=new Fade();
			tempEf.alphaFrom=0;
			tempEf.alphaTo=1;
			tempEf.target=this;
			tempEf.duration=3000;
			tempEf.play();
			this.tempEf.addEventListener(EffectEvent.EFFECT_END,efEnd);
		}
		public function efEnd(e:EffectEvent):void{
			this.blinkTimer.addEventListener( "timer" , toggleText );
			this.blinkTimer.start(); 
		}
		public function toggleText( event:TimerEvent ):void
		{
			if( this.visible ){			
				this.visible = false;				
			}else{			
				this.visible = true;				
			}		
		}
		
		public function get interval():uint
		{
			return this.blinkTimer.delay;
		}
		public function set interval( value:uint ):void
		{
			this.blinkTimer.delay = value;		
		}
				
	}
	
}